package com.neusoft.demo6;


public class Demo {
    public int m1(int a) {
        return a;
    }

    public String m2(String name) {
        return name;
    }

    public int[] m3(int[] array) {
        return array;
    }

    public Person m4() {
        //Person p = new PersonImpl();
        return new PersonImpl();
    }

    public void m5(Person person) {
        person.study();
        person.eat();
        person.sleep();
    }

    public A m6() {
        return new AImpl();
    }

    public void m7(A a) {
        a.song();
        a.walk();
    }
    public static void main(String[] args) {
        Demo demo = new Demo();
        demo.m1(1);
        demo.m2("tom");
        int[] arr = {1,2,3,4};
        int[] array = demo.m3(arr);
        for (int i = 0;i<array.length;i++) {
            System.out.println(array[i]);
        }
        Person person = demo.m4(); //PersonImpl对象
        person.eat();
        demo.m5(new PersonImpl());
        A aa = demo.m6(); //AImpl对象
        aa.walk();
        demo.m7(new AImpl());
    }
}
